//# sourceURL=swiper.js
jQuery._swiper = function($this,direction,cb){
    var x, y, X, Y, swipeX, swipeY;
    $this.on('touchstart',function(e) {
        x = event.changedTouches[0].pageX;
        y = event.changedTouches[0].pageY;
        swipeX = true;
        swipeY = true;
    });
    $this.on('touchmove',function(e) {
        X = event.changedTouches[0].pageX;
        Y = event.changedTouches[0].pageY;
        // 上下滑动
        if (swipeY && Math.abs(X - x) - Math.abs(Y - y) < 0) {
            swipeX = false;
        }
        // 左右滑动
        if (swipeX && Math.abs(X - x) - Math.abs(Y - y) > 0) {
            // 阻止事件冒泡
            event.stopPropagation();
            if (X - x > 10) {   //右滑
                event.preventDefault();
                this.direction = 'right';
            }
            if (x - X > 10) {   //左滑
                event.preventDefault();
                this.direction = 'left';
            }
        }

    })
    $this.on('touchend',function () {
        if ((this.direction&&this.direction=='right'&&direction=='right')||(this.direction&&this.direction=='left'&&direction=='left')){
            cb();
        }
    })
};
$.fn.swipeLeft = function(cb){
    jQuery._swiper(this,'left',cb);
};
$.fn.swipeRight = function(cb){
    jQuery._swiper(this,'right',cb);
};